<#assign ctx=Session.basePath>

<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
<#include "include/include.ftl">
    <title>船e行公司端-<#if Session['user'].name??>${Session['user'].name}<#else>${Session['user'].loginname}</#if></title>

    <style>
        .ibox-tools a {
            color: #000000;
        }
    </style>

    <script>
        $(window).resize(function () {
            setTimeout(resizeIframe(), 700);
//            resizeIframe();
        });

        function resizeIframe() {
            var height = $("#page-wrapper").height();
            height = height -45;
            $(".J_iframe").height(height);
        }
    </script>
</head>

<body>

<script>
    var prefix = "";
</script>

<script type="text/javascript">
    $(function () {
        $('#tabs').addtabs();
        $(".activeHref").click(function () {
            var item = $(this);
            var url = $(this).attr('url');
            if (url == '#') {
                return;
            }
            Addtabs.add({
                id: $(this).attr('addtabs'),
                title: $(this).attr('title') ? $(this).attr('title') : $(this).html(),
                content: Addtabs.options.content ? Addtabs.options.content : $(this).attr('content'),
                url: $(this).attr('url'),
                ajax: $(this).attr('ajax') ? true : false
            })
        });

        $('#save').click(function () {

        });
    })
</script>


<div id="wrapper">

<#include "common/nav-side.ftl">



    <div id="page-wrapper" class="gray-bg">
        <#--<div class="row border-bottom">-->
        <#--<#include "common/nav-top.ftl">-->
        <#--</div>-->
        <div class="wrapper content-tabs">
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" data-id="${ctx}/home">首页</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
                </button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                    </button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li class="J_tabShowActive"><a>定位当前选项卡</a>
                        </li>
                        <li class="divider"></li>
                        <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                        </li>
                        <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                        </li>
                    </ul>
                </div>
                <a href="${ctx}/manage/user/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" src="${ctx}/manage/ship/list" frameborder="0"
                        data-id="${ctx}/home" seamless></iframe>
            </div>
        <#--<iframe width="100%" height="100%" frameborder="0"  name="mainFrame" id="mainFrame" src="<%=basePath%>admin/welcome.jsp"></iframe>-->
        </div>
    <#--<#include "common/footer.ftl">-->
    </div>
</div>
</div>

<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
    });


    var hei = document.body.clientHeight;
    var iframHeight = hei - 100;


    $(".nav-second-level li").click(function () {
        var me = $(this);
        $(".nav-second-level li").removeClass("active");
        me.addClass("active");
    })

    var tabTitleHeight = 60;

    $.fn.initJerichoTab({
        renderTo: '#right', uniqueId: 'jerichotab',
        contentCss: {'height': $(window).height() - 165},
        tabs: [], loadOnce: true, tabWidth: 110, titleHeight: tabTitleHeight
    });
    // 初始化点击第一个一级菜单
    $("#menu a.menu:first span").click();

    $("#userInfo .dropdown-menu a").mouseup(function () {
        return addTab($(this), true);
    });
    // 鼠标移动到边界自动弹出左侧菜单
    $("#openClose").mouseover(function () {
        if ($(this).hasClass("open")) {
            $(this).click();
        }
    });

    function addTab($this, refresh) {
        $(".jericho_tab").show();
        $("#mainFrame").hide();
        $.fn.jerichoTab.addTab({
            tabFirer: $this,
            title: $this.text(),
            closeable: true,
            data: {
                dataType: 'iframe',
                dataLink: $this.attr('href')
            }
        }).loadData(refresh);
        return false;
    }

    $(document).ready(function () {
        resizeIframe();
    })

</script>

<script>
    //    var hei = document.body.clientHeight;
    //    var iframHeight = hei - 100;
    //    resizeIframe(iframHeight);
    //    $(window).resize(function() {
    //        var width = $(this).width();
    //        var height = $(this).height();
    //        resizeIframe(height-100);
    //    });
    //
    //    function resizeIframe(height) {
    //        $("#mainFrame").height(height);
    //    }


    $(".nav-second-level li").click(function () {
        var me = $(this);
        $(".nav-second-level li").removeClass("active");
        me.addClass("active");
    })

</script>


</body>
</html>
